package com.basic.web.controller.tool;

import com.basic.common.annotation.Log;
import com.basic.common.core.controller.BaseController;
import com.basic.common.core.domain.AjaxResult;
import com.basic.common.core.page.TableDataInfo;
import com.basic.common.enums.BusinessStatus;
import com.basic.common.enums.BusinessType;
import com.basic.common.utils.SecurityUtils;
import com.basic.common.websocket.WebSocketUsers;
import com.basic.tool.domain.SysDownloadCenter;
import com.basic.tool.service.ISysDownloadCenterService;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

/**
 * 下载中心Controller
 * 
 * @author zhaoxy_jn@163.com
 * @date 2024-07-04
 */
@RestController
@RequestMapping("/tool/downloadCenter")
public class SysDownloadCenterController extends BaseController
{
    @Resource
    private ISysDownloadCenterService sysDownloadCenterService;

    /**
     * 查询下载中心列表
     */
    @GetMapping("/list")
    @PreAuthorize("@ss.hasPermi('tool:downloadCenter:list')")
    public TableDataInfo list(SysDownloadCenter sysDownloadCenter)
    {
        startPage();
        List<SysDownloadCenter> list = sysDownloadCenterService.getList(sysDownloadCenter);
        return getDataTable(list);
    }

    /**
     * 删除下载中心
     */
    @Log(title = "下载中心", businessType = BusinessType.DELETE)
    @PreAuthorize("@ss.hasPermi('tool:downloadCenter:remove')")
	@DeleteMapping("/{id}")
    public AjaxResult remove(@PathVariable String id)
    {
        return toAjax(sysDownloadCenterService.delete(id));
    }
}
